namespace Daemon.Model.Entities
{
    using System;
    using Daemon.Data.Substructure.Enums;
    public class ReportingEntityDto
    {
        public long ReportingPK { get; set; }

        public string ReportingEntity { get; set; }
    }

    public enum PlaceholderTermType
    {
        /// <summary>
        /// Wrapped in %%, such as %CHANGEDFIELDS%
        /// </summary>
        KeyWord,

        /// <summary>
        /// Wrapped in [], properties in changed entity.
        /// </summary>
        ChangedEntityField,

        /// <summary>
        /// Wrapped in ~~, calculated field by sql in table LogRuleCalculatedField
        /// </summary>
        CalculatedField,

        /// <summary>
        /// Wrapped in @@, value is saved in extra data for every changed entity, pattern in sql: @key1|value1;key2|value2@
        /// </summary>
        EntityExtraKeyValue,

        /// <summary>
        /// Wrapped in {}, pattern in sql: {table1.field1}
        /// </summary>
        LookupValue,
    }

    public class PlaceholderTerm
    {
        public PlaceholderTermType TermType { get; set; }

        public string Word { get; set; }

        public string RawWord { get; set; }

        public int Sequence { get; set; }
    }

    public class ConstraintTableInfo
    {
        public string ConstraintName { get; set; }

        public string ReferencingTableName { get; set; }

        public string ReferencingColumnName { get; set; }

        public string ReferencedTableName { get; set; }

        public string ReferencedColumnName { get; set; }
    }

    public class EntityMetaInfo
    {
        public string DescriptiveNameField { get; set; }
    }

    public class TrackedField : LogRuleMonitoringField
    {
        public string OldVal { get; set; }

        public string NewVal { get; set; }

        public EntityChangeType ChangeType { get; set; }

        public bool Changed { get; set; }

        public Type ValueType { get; set; }
    }

}